﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using ExpenseSystem.Common;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Core.DataAddOn;

namespace ExpenseSystem.Core.TitleModules
{
    public class TitleBaseManager: TitleManager
    {
        protected UserProfile userProfile = Authority.Authority.GetUserProfile();
        public override bool Delete(TitleModel title,  out string message)
        {
            TitleFetcher fetcher = new TitleFetcher();
            return updater.Remove(title, tran, fetcher, out message);
        }

        public override bool DeleteById( long[] title,  out string message)
        {
            TitleFetcher fetcher = new TitleFetcher();
            return updater.RemoveById(userProfile.SiteId, title, tran, fetcher, out message);
        }

        public override bool Save(TitleModel title, out string message, params IAddable<TitleModel>[] addable)
        {
            TitleFetcher fetcher = new TitleFetcher();
            return updater.Save(title, tran, fetcher, out message);
        }
    }
}
